class mynum:
    def __init__(self, a, b):
        self.a = a
        self.b = b

    def __str__(self):
        return str(self.a) +',' +str(self.b)

    def __lt__(self, other):
        return self.a < other.a

    def __gt__(self, other):
        return self.a > self.a


t1 = mynum(2, 5)
t2 = mynum(3, 6)

print t1<t2

l = [t2, t1]

print l[0], l[1]
l.sort()

print l[0], l[1]
